<?php

use Illuminate\Http\Request;
use Illuminate\Support\Facades\Route;

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/
Route::get('/', 'HomeController@index');
Route::get('show_persons', 'HomeController@show');
Route::get('cache', 'HomeController@cache');
Route::get('/login', function () {
    return response()->json(
        [
            'home' => 'yes'
        ],
        200
    );
})->name('login');

Route::post('register', 'TestController@register');
Route::post('login', 'TestController@login');

Route::middleware('auth:airlock')->get('/user', function (Request $request) {
    return $request->user();
});
Route::get('article', 'TestController@editArticle')->middleware('auth:airlock');
Route::get('logout', 'TestController@logout')->middleware('auth:airlock');

Route::post('person', 'PersonController@create');
Route::post('person/{person}', 'PersonController@update');
Route::get('person/{person}', 'PersonController@show');
Route::delete('person/{person}', 'PersonController@delete');
Route::get('person/{person}', 'PersonController@show');

